/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.close.basic.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.close.common.constant.enums.ParkCloseSysDictEnum;
import com.hopes.bizz.common.core.util.DateUtils;
import com.hopes.bizz.video.common.constant.enums.VideoModDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 出入园卡口信息
 *
 * @author pig
 * @date 2023-10-20 16:01:48
 */
@Data
@TableName("closed_gate")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "出入园卡口信息")
public class ClosedGateEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;


	/**
	* ID
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="ID")
    private Long id;

	/**
	* 卡口名称
	*/
    @Schema(description="卡口名称")
    private String name;

	/**
	 * 联网状态
	 */
	@Schema(description="联网状态")
	private String networkStatus;

	/**
	* 卡扣类型
	*/
    @Schema(description="卡口类型")
    private String gateType;

	/**
	 * 卡口分类
	 */
	@Schema(description = "卡口分类")
    private String gateClassify;

	/**
	* 卡口位置
	*/
    @Schema(description="卡口位置")
    private String gateLocation;

	/**
	* 卡口位置描述
	*/
    @Schema(description="卡口位置描述")
    private String gateAddress;


	/**
	* 是否使用
	*/
    @Schema(description="是否使用")
    private String useFlag;

	/**
	* 是否允许入场
	*/
    @Schema(description="是否允许入场")
    private String allowEnterFlag;

	/**
	* 是否允许出场
	*/
    @Schema(description="是否允许出场")
    private String allowLeaveFlag;

	/**
	* 车道数
	*/
    @Schema(description="车道数")
    private Integer roadNum;


	/**
	 * 车道描述
	 */
	@Schema(description="车道描述")
    private String roadDesc;

	/**
	 * 车道图片
	 */
	@Schema(description="车道图片")
	private String roadImage;

	/**
	* 通行车辆类型
	*/
    @Schema(description="通行车辆类型")
    private String passType;

	/**
	* 最后通行时间
	*/
    @Schema(description="最后通行时间")
    private Date latestPassTime;

	/**
	* 海康编码
	*/
    @Schema(description="海康编码")
    private String hikIndex;

	/**
	* 海康区域
	*/
    @Schema(description="海康区域")
    private String hikRegionId;

	/**
	* 视频Id
	*/
    @Schema(description="视频Id")
    private String videoId;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remark;

	/**
	 * 机构ID
	 */
	@Schema(description="机构ID")
	private Long orgId;


	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.getOrgId());
	}

	public String getLatestPassTimeStr() {
		return DateUtils.limitSecond(this.getLatestPassTime());
	}

    public String getGateTypeStr() {
        return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_park_company_type, this.getGateType());
    }

    public String getGateClassifyStr() {
    	return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_gate_access_classify, this.getGateClassify());
	}

    public String getUseFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.useFlag);
    }

    public String getAllowEnterFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.allowEnterFlag);
    }

    public String getAllowLeaveFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.allowLeaveFlag);
    }

    public String getPassTypeStr() {
    	return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_gate_pass_type, this.getPassType());
	}

	public String getHikRegionIdStr() {
		return DictResolver.getItemLabelByValue(VideoModDictEnum.video_region, this.getHikRegionId());
	}

	public String getVideoIdStr() {
		return DictResolver.getItemLabelByValue(VideoModDictEnum.video, this.getVideoId());
	}

	public String getNetworkStatusStr() {
		return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_device_network_status, this.getNetworkStatus());
	}
}
